import { createApp } from 'vue'
import router from './router'
import App from './App.vue'
import lazy from './directives/lazy'
import bubbling from './directives/bubbling'
import store from './store'
import {
  NButton,
  create,
  NLayoutHeader,
  NLayoutContent,
  NLayoutFooter,
  NLayout,
  NMenu,
  NCard,
  NForm,
  NFormItem,
  NInput,
  NImageGroup,
  NImage,
  NSpace,
  NIcon,
  NCarousel,
  NSwitch
} from "naive-ui"
import { MessageApiInjection } from 'naive-ui/lib/message/src/MessageProvider'
declare global {
  interface Window {
    $message: MessageApiInjection
  }
}
const naive = create({
  components: [
    NButton,
    NLayoutHeader,
    NLayoutContent,
    NLayoutFooter,
    NLayout,
    NMenu,
    NCard,
    NForm,
    NInput,
    NFormItem,
    NImageGroup,
    NImage,
    NSpace,
    NIcon,
    NCarousel,
    NSwitch
  ]
})

const app = createApp(App);
app.use(naive)
app.use(lazy)
app.use(bubbling)
app.use(router)
app.use(store)
app.mount('#app')
